package STUDENT.TRANBANGTUNG.day05_23_2016.ex9simple;

import java.util.Scanner;

public class View {
	public static void main(String[] args) {
		System.out.println("nhap so luong sinh vien!");
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		System.out.println("nhap so luong cau hoi!");
		sc = new Scanner(System.in);
		int b = sc.nextInt();
		Object obj = new Object(a, b);
		String[][] arAnswer = new String[a][b];
		for (int i = 0; i < obj.getArAnswer().length; i++) {
			for (int j = 0; j < obj.getArAnswer()[i].length; j++) {
				System.out.println("nhap cau tra loi " + (j + 1) + " cua sinh vien " + (i + 1));
				sc = new Scanner(System.in);
				arAnswer[i][j] = sc.nextLine();
			}
			obj.setArAnswer(arAnswer);
		}
		//
		for (int i = 0; i < obj.getArAnswer().length; i++) {
			for (int j = 0; j < obj.getArAnswer()[i].length; j++) {
				System.out.println("b1: "+obj.getArAnswer()[i][j]);
			}}
		//
		String[] arRightAnswer = new String[b];
		for (int j = 0; j < obj.getArRightAnswer().length; j++) {
			System.out.println("nhap gia tri dung cua cau tra loi thu " + (j + 1));
			sc = new Scanner(System.in);
			arRightAnswer[j] = sc.nextLine();
		}
		obj.setArRightAnswer(arRightAnswer);
		//
		for (int j = 0; j < obj.getArRightAnswer().length; j++) {
			System.out.println("b2: "+obj.getArRightAnswer()[j]);
		}
		//
		Controller con = new Controller();
		int [] c=new int [a];
		c= con.calculator(obj);
		for (int i = 0; i < a; i++) {
			System.out.println("diem sinh vien thu "+(i+1)+" la: " + c[i]);
		}
	}
}
